package com.lorenzogao.customview

import android.animation.ObjectAnimator

import android.os.Bundle
import android.view.animation.DecelerateInterpolator
import com.lorenzogao.customviewexample.R

import kotlinx.android.synthetic.main.activity_qqstep.*
import kotlinx.android.synthetic.main.layout_head.*


/**
 *  QQ 步数
 */
class QQStepActivity : BaseActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_qqstep)

        setToolBar(toolbar, "QQ步数")


        val objectAnimator = ObjectAnimator.ofInt(0, 1100)
        objectAnimator.interpolator = DecelerateInterpolator()  // 差值器
        objectAnimator.duration=1000  // 设置动画时间

        objectAnimator.addUpdateListener {
            step_view.setCurrentValue(it.animatedValue as Int)
        }
        objectAnimator.start()

        btn_start.setOnClickListener {
            objectAnimator.start()
        }



    }





}
